package com.liyuxiang.controller;

import com.liyuxiang.mapper.CommentMapper;
import com.liyuxiang.pojo.entity.Comment;
import com.liyuxiang.pojo.vo.CommentVo;
import com.liyuxiang.service.CommentService;
import com.liyuxiang.vm.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/comment")
public class CommentController {
    @Autowired
    private CommentService commentService;
    @GetMapping("/commentList")
    public ResponseResult getCommentList(Long articleId,Integer pageNum,Integer pageSize){
        return commentService.getCommentList(articleId,pageNum,pageSize);
    }

    @PostMapping("")
    public ResponseResult addComment(@RequestBody Comment comment){

        return commentService.addComment(comment);

    }
}
